//
// Created by admin on 2022/10/9.
// Copyright (c) 2022 122674287@qq.com. All rights reserved.
//

#import <CYHUD.h>
#import "CYOneViewController.h"
#import "CYTwoViewController.h"
#import "CYHUD+Status.h"
#import "CYHUD+LoadingText.h"

@implementation CYOneViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationTitle = @"CYOneViewController";
    self.navLeftBtn = [self defaultNavLeftBtn];
    self.navigationStatusBarColor = CYNavStatusBarColor_White;

    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(100, 100, 100, 100);
    button.backgroundColor = [UIColor redColor];
    [button addTarget:self action:@selector(onBtnTap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];

//    self.hiddenNavigationBar = YES;

    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    button1.frame = CGRectMake(100, 250, 100, 50);
    button1.backgroundColor = [UIColor redColor];
    [button1 addTarget:self action:@selector(onBtn1Tap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button1];

    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    button2.frame = CGRectMake(100, 350, 100, 50);
    button2.backgroundColor = [UIColor redColor];
    [button2 addTarget:self action:@selector(onBtn2Tap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button2];

    UIButton *button3 = [UIButton buttonWithType:UIButtonTypeCustom];
    button3.frame = CGRectMake(100, 450, 100, 50);
    button3.backgroundColor = [UIColor redColor];
    [button3 addTarget:self action:@selector(onBtn3Tap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button3];
    UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom];
    button4.frame = CGRectMake(100, 550, 100, 50);
    button4.backgroundColor = [UIColor grayColor];
    [button4 addTarget:self action:@selector(onBtn4Tap:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button4];
}

- (void)onBtnTap:(UIButton *)sender {
    CYTwoViewController *two = [[CYTwoViewController alloc] init];
    [self.navigationController pushViewController:two animated:YES];
}

- (void)onBtn1Tap:(UIButton *)sender {
    [CYHUD showSuccessWithText:@"加载成功"];

}

- (void)onBtn2Tap:(UIButton *)sender {
    [CYHUD showErrorWithText:@"加载失败"];

}

- (void)onBtn3Tap:(UIButton *)sender {
    [CYHUD showInfoWithText:@"信息..."];

}

- (void)onBtn4Tap:(UIButton *)sender {
//    [CYHUD showInfoWithText:@"信息..."];
    [CYHUD showText:@"123" inView:self.view];
}
@end